package com.yupi.springbootinit.model.vo;

import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * PMC任务详情VO
 */
@Data
public class PMCTaskDetailVO implements Serializable {

    // ==================== 任务基本信息 ====================
    private String taskId;
    private String taskTitle;
    private String taskDescription;
    private String taskType;
    private String taskStatus;
    private LocalDateTime expectedCompleteTime;
    private String claimedByName;
    private LocalDateTime claimedTime;
    private LocalDateTime taskCreateTime;

    // ==================== 订单基本信息 ====================
    private Long orderId;
    private String orderNumber;
    private String orderType;
    private String customerName;
    private LocalDateTime dueDate;
    private String urgencyLevel;
    private String qualityLevel;
    private String specialRequirement;
    private String orderStatus;
    private LocalDateTime orderCreateTime;

    // ==================== 产品信息（单产品，兼容老逻辑）====================
    private String productCode;
    private String productName;
    private String specification;
    private Integer quantity;

    // ==================== ✅ 新增：产品列表（支持多产品）====================
    /**
     * 工艺单产品明细列表
     */
    private List<ProductDetailVO> products;

    /**
     * 批次产品分配列表（仅子任务有值）
     */
    private List<BatchProductVO> batchProducts;

    // ==================== 材料信息 ====================
    private String materialPowder;
    private String materialBrand;
    private String materialSpec;
    private String powderSupplier;

    // ==================== 设备信息 ====================
    private String machineModel;
    private List<String> availableDevices;

    // ==================== 工艺单信息 ====================
    private Long processSheetId;
    private String processSheetNo;
    private String processStatus;
    private String supportWeight;
    private String technicalRequirements;
    private String processFileIds;
    private String processSheetCreatedByName;
    private LocalDateTime processSheetCreateTime;

    // ==================== 工序信息 ====================
    private List<ProcessSheetStepVO> steps;

    // ==================== 批次信息 ====================
    private Integer batchCount;
    private List<String> batches;

    // ==================== 其他信息 ====================
    private String currentNode;
    private Integer progress;
    private Boolean isOverdue;
    private Integer remainingDays;
    private String remark;

    // ==================== 内部类：产品明细 ====================
    @Data
    public static class ProductDetailVO implements Serializable {
        private String id;
        private String processSheetId;
        private String orderItemId;
        private String productCode;
        private String productName;
        private String specification;
        private Integer quantity;
        private String partDrawingNo;
        private BigDecimal unitWeight;
        private BigDecimal productHeight;
        private Integer sortOrder;
        private String remark;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;
    }

    // ==================== 内部类：批次产品分配 ====================
    @Data
    public static class BatchProductVO implements Serializable {
        private String id;
        private String batchId;
        private String processSheetId;
        private String productId;
        private BigDecimal productHeight;
        private String productCode;
        private String productName;
        private Integer productionQuantity;
        private LocalDateTime createTime;
        private LocalDateTime updateTime;
    }

    // ==================== 内部类：工序步骤 ====================
    @Data
    public static class ProcessSheetStepVO implements Serializable {
        private Integer sequenceNo;
        private String operationName;
        private Integer isInspectionRequired;
        private Integer isOutsourced;
    }

    private static final long serialVersionUID = 1L;
}